#include "demo.h"
#include "nextdemo.h"

void do_child(Child c)
{
    c.SetName("Hevake");
    c.SetAge(12);
    c.Eat();
}

void do_student(Student s)
{
    s.Learn();
}

int main()
{
    demo *pd = new demo;
    IF1 *pf1 = pd;
    IF2 *pf2 = pd;
    IF3 *pf3 = pd;

    pf1->DoThis();
    pf1->Get();
    pf2->DoThat();
    pf2->Print();
    pf2->Get();
    pf3->Get();
    pf3->Print();
    delete pf1;

    Boy b;
    Child c = b.GetChildRole();
    do_child(c);
    Student s = b.GetStudentRole();
    do_student(s);
}
